package org.lzuploader.model.message;

/** This class is used to easily transmit messages from one class to another.
 * 
 * @author Emmanuel Cron
 *
 */

public abstract class AbstractMessage
{
    /** Title of the message. */
    private String iTitle;
    
    /** Contents of the message. */
    private String iContents;
    
    /** Creates a new message.
     * 
     * @param title Title of the info
     * @param contents Contents of the info
     */
    public AbstractMessage(final String title, final String contents)
    {
        iTitle = title;
        iContents = contents;
    }
    
    /** Returns the title of this message.
     * 
     * @return The title of the message
     */
    public String getTitle()
    {
        return iTitle;
    }
    
    /** Returns the contents of this message.
     * 
     * @return A string detailling the message
     */
    public String getContents()
    {
        return iContents;
    }
    
    /** Returns wether this message is informational or not.
     * Warning: a message cannot be informational and an error at the same time
     * @return <code>true</code> if this message is informational, <code>false</code> otherwise
     */
    public abstract boolean isInfo();
    
    /** Returns wether this message is an error or not.
     * Warning: a message cannot be informational and an error at the same time
     * @return <code>true</code> if this message is an error, <code>false</code> otherwise
     */
    public abstract boolean isError();
}
